﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DBMock.Builders
{
    /// <summary>
    /// 整数Builder
    /// </summary>
    public class IntBuilder : Builder
    {
        private int min; //最小值
        private int max; //最大值

        /// <summary>
        /// 初始化IntBuilder
        /// </summary>
        /// <param name="min">最小值</param>
        /// <param name="max">最大值</param>
        public IntBuilder(int seed, int min, int max)
            : base(seed)
        {
            if (min > max)
            { throw new Exception("Minimum is larger than maximum."); }

            this.min = min;
            this.max = max;
        }

        public override object Build()
        {
            return random.Next(min, max);
        }
    }
}
